function MakepOptions()
	LocalPlayer():EmitSound("buttons/lightswitch2.wav", 100, 30)

	if IsValid(pOptions) then
		pOptions:SetAlpha(0)
		pOptions:AlphaTo(255, 0.5, 0)
		pOptions:SetVisible(true)
		pOptions:MakePopup()
		return
	end

	local wide, tall = 500, ScrH() * 0.9

	local Window = vgui.Create("DFrame")
	Window:SetSize(wide, tall)
	Window:Center()
	Window:SetTitle(" ")
	Window:SetDeleteOnClose(true)
	Window:SetCursor("pointer")
	pOptions = Window

	local y = 8

	local label = EasyLabel(Window, GAMEMODE.Name.." Options", "ScoreboardText", color_white)
	label:CenterHorizontal()
	label:AlignTop(4)
	y = y + label:GetTall() + 8

	local list = vgui.Create("DPanelList", pOptions)
	list:EnableVerticalScrollbar()
	list:EnableHorizontal(false)
	list:SetSize(wide - 24, tall - y - 12)
	list:SetPos(12, y)
	list:SetPadding(8)
	list:SetSpacing(4)

	local check = vgui.Create("DCheckBoxLabel", Window)
	check:SetText("Auto Join Queue")
	check:SetConVar("hovergear_auto_join")
	check:SizeToContents()
	list:AddItem(check)
	
	local check = vgui.Create("DCheckBoxLabel", Window)
	check:SetText("Enable Spectator Mode (Crowd Only)")
	--[[check.Think = function(me, index, value, data)
		me:SetChecked(tonumber(GetConVarString("hovergear_spec_mode")))
	end]]
	check:SetConVar("hovergear_spec_mode")
	check:SizeToContents()
	list:AddItem(check)

	--[[local check = vgui.Create("DCheckBoxLabel", Window)
	check:SetText("Not First Timer anymore (Changes upon rejoining)")
	check:SetConVar("hovergear_first_timer")
	check:SizeToContents()
	list:AddItem(check)]]

	local check = vgui.Create("DCheckBoxLabel", Window)
	check:SetText("Film Mode (disable most of the HUD)")
	check:SetConVar("hovergear_film_mode")
	check:SizeToContents()
	list:AddItem(check)
	
	local slider = vgui.Create("DNumSlider", Window)
	slider:SetDecimals(2)
	slider:SetMinMax(1, 2)
	slider:SetConVar("hovergear_refresh_rate")
	slider:SetText("Scoreboard Refresh Rate")
	slider:SizeToContents()
	list:AddItem(slider)

	local slider = vgui.Create("DNumSlider", Window)
	slider:SetDecimals(0)
	slider:SetMinMax(0, 100)
	slider:SetConVar("hovergear_radio_volume")
	slider:SetText("Radio Volume")
	slider:SizeToContents()
	list:AddItem(slider)

	list:AddItem(EasyLabel(Window, " ", "DefaultSmall", COLOR_WHITE))

	list:AddItem(EasyLabel(Window, "Vehicle Coloring Method", "DefaultSmall", COLOR_WHITE))
	local dropdown = vgui.Create("DComboBox", Window)
	dropdown:SetMouseInputEnabled(true)
	dropdown:AddChoice("None", 0)
	dropdown:AddChoice("Player Model Color", 1)
	dropdown:AddChoice("Weapon Model Color", 2)
	dropdown:AddChoice("Custom Vehicle Color", 3)
	local id = GAMEMODE.HoverGear_VehicleColType
	dropdown:ChooseOption(id == 3 and "Custom Vehicle Color" or id == 2 and "Weapon Model Color" or id == 1 and "Player Model Color" or "None")
	dropdown.OnSelect = function(me, index, value, data)
		RunConsoleCommand("hovergear_vcol_type", value == "Custom Vehicle Color" and 3 or value == "Weapon Model Color" and 2 or value == "Player Model Color" and 1 or 0)
	end
	list:AddItem(dropdown)
	
	list:AddItem(EasyLabel(Window, " ", "DefaultSmall", COLOR_WHITE))
	
	list:AddItem(EasyLabel(Window, "Player Model Color (Changes upon death)", "DefaultSmall", COLOR_WHITE))
	local colpicker = vgui.Create("DColorMixer", Window)
	colpicker:SetAlphaBar(false)
	colpicker:SetPalette(false)
	colpicker:SetVector(Vector(GetConVarString("cl_playercolor")))
	colpicker.Think = function()
		RunConsoleCommand("cl_playercolor", tostring(colpicker:GetVector()))
	end
	colpicker:SetTall(120)
	list:AddItem(colpicker)

	list:AddItem(EasyLabel(Window, " ", "DefaultSmall", COLOR_WHITE))
	
	list:AddItem(EasyLabel(Window, "Weapon Model Color (Changes upon death)", "DefaultSmall", COLOR_WHITE))
	local colpicker = vgui.Create("DColorMixer", Window)
	colpicker:SetAlphaBar(false)
	colpicker:SetPalette(false)
	colpicker:SetVector(Vector(GetConVarString("cl_weaponcolor")))
	colpicker.Think = function()
		RunConsoleCommand("cl_weaponcolor", tostring(colpicker:GetVector()))
	end
	colpicker:SetTall(120)
	list:AddItem(colpicker)
	
	list:AddItem(EasyLabel(Window, " ", "DefaultSmall", COLOR_WHITE))
	
	list:AddItem(EasyLabel(Window, "Custom Vehicle Color (Changes are instantly)", "DefaultSmall", COLOR_WHITE))
	local colpicker = vgui.Create("DColorMixer", Window)
	colpicker:SetAlphaBar(false)
	colpicker:SetPalette(false)
	colpicker:SetConVarR("hovergear_vcol_r")
	colpicker:SetConVarG("hovergear_vcol_g")
	colpicker:SetConVarB("hovergear_vcol_b")
	colpicker:SetTall(120)
	list:AddItem(colpicker)

	Window:Center()
	Window:MakePopup()

	Window:SetAlpha(0)
	Window:AlphaTo(255, 0.5, 0)
	Window:MakePopup()
end

concommand.Add("hg_optionsopen", MakepOptions)